package com.shigen.demo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.shigen.demo.util.serializer.CustomDateSerializer;
import com.shigen.demo.util.serializer.CustomPhoneSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * userinfo
 *
 * @author
 */
@ApiModel(value = "com.shigen.demo.entity.Userinfo用户的信息")
@Data
@Accessors(chain = true)
@TableName(value = "user_info")
public class UserInfo implements Serializable {

  /**
   * 自增的ID
   */
  @ApiModelProperty(value = "自增的ID")
  @TableId(type = IdType.AUTO)
  private Integer autoId;

  /**
   * userid
   */
  @ApiModelProperty(value = "userid")
  private Integer userId;

  /**
   * 用户名
   */
  @ApiModelProperty(value = "用户名")
  private String userName;

  /**
   * 性别 0---男 1---女
   */
  @ApiModelProperty(value = "性别 0---男 1---女")
  private Boolean sex;

  /**
   * 电子邮箱
   */
  @ApiModelProperty(value = "电子邮箱")
  private String email;

  /**
   * 联系电话
   */
  @ApiModelProperty(value = "联系电话")
  @JsonSerialize(using = CustomPhoneSerializer.class)
  private String phone;

  /**
   * 地区
   */
  @ApiModelProperty(value = "地区")
  private String region;

  /**
   * 注册时间
   */
  @ApiModelProperty(value = "注册时间")
  @JsonSerialize(using = CustomDateSerializer.class)
  private Date regTime;

  /**
   * 地址
   */
  @ApiModelProperty(value = "地址")
  private String address;

  /**
   * 生日
   */
  @ApiModelProperty(value = "生日")
  @JsonSerialize(using = CustomDateSerializer.class)
  private Date birthday;

  /**
   * 用户头像的保存路径
   */
  @ApiModelProperty(value = "用户头像的保存路径")
  private String iconPath;

  /**
   * 是否在职 1表示不在 0表示在
   */
  @ApiModelProperty(value = "是否在职 1表示不在 0表示在")
  private Boolean isActive;

  /**
   * 是否删除 0表示删除 1表示不删除
   */
  @ApiModelProperty(value = "是否删除 0表示删除 1表示不删除")
  @TableLogic
  private Boolean isDel;

  /**
   * 创建时间
   */
  @ApiModelProperty(value = "创建时间")
  @JsonSerialize(using = CustomDateSerializer.class)
  @TableField(fill = FieldFill.INSERT)
  private Date createTime;

  /**
   * 更新时间
   */
  @ApiModelProperty(value = "更新时间")
  @Version
  @JsonSerialize(using = CustomDateSerializer.class)
  @TableField(fill = FieldFill.INSERT_UPDATE)
  private Date updateTime;

  /**
   * 创建人ID
   */
  @ApiModelProperty(value = "创建人id")
  private Integer createUserId;

  /**
   * 创建人名字
   */
  @ApiModelProperty(value = "创建人名字")
  private String createUserName;

  private static final long serialVersionUID = 1L;
}
